package mysql

import "gorm.io/gorm"

type Manuscript struct {
	gorm.Model
	Title   string `gorm:"type:varchar(100)"`
	Price   int    `gorm:"type:int(50)"`
	ClassId int    `gorm:"type:int(10)"`
}

func (m *Manuscript) ManuscriptAdd(db *gorm.DB) error {
	return db.Create(m).Error
}

func (m *Manuscript) FindManuscriptName(db *gorm.DB, title string) error {
	return db.Where("title=?", title).First(m).Error
}
